package com.sx.zongzhi.presenter;

import com.sx.zongzhi.MyApplication;
import com.sx.zongzhi.bean.ProcessBean;
import com.sx.zongzhi.modle.ApiManager;
import com.sx.zongzhi.net.BaseCallBack;
import com.sx.zongzhi.net.BaseResult;
import com.sx.zongzhi.view.IDisputeProcessView;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by XZY on 2017/12/1.
 *获取矛盾纠纷处理过程
 */
public class DisputeProcessPest {

    private IDisputeProcessView processView;

    public DisputeProcessPest(IDisputeProcessView processView) {
        this.processView=processView;
    }


    /**
     * 获取矛盾纠纷处理过程
     * @param id 事件主键
     */
    public void getProcessList(String id){
        Map<String,Object> map=new HashMap<>();
        map.put("sid", MyApplication.sid);
        map.put("id",id);
        new ApiManager().getDisputeProcess(map, new BaseCallBack<BaseResult<List<ProcessBean>>>() {
            @Override
            public void onSuccess(BaseResult<List<ProcessBean>> response) {
                processView.getProcessList(response.getData());
            }
            @Override
            public void onFailures(String message) {
                processView.showError(message);
            }
        });
    }

}
